<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta content="width=device-width, initial-scale=1.0" name="viewport">

  <!-- 引入刚刚下载的 ECharts 文件 -->
  <script src="static/assets/js/echarts.js"></script>

  <title>豆瓣电影Top250评分</title>
  <meta content="" name="descriptison">
  <meta content="" name="keywords">

  <!-- Favicons -->
  <link href="static/assets/img/favicon.png" rel="icon">
  <link href="static/assets/img/apple-touch-icon.png" rel="apple-touch-icon">

  <!-- Google Fonts -->
  <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Raleway:300,300i,400,400i,600,600i,700,700i,900" rel="stylesheet">

  <!-- Vendor CSS Files -->
  <link href="static/assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
  <link href="static/assets/vendor/icofont/icofont.min.css" rel="stylesheet">
  <link href="static/assets/vendor/boxicons/css/boxicons.min.css" rel="stylesheet">
  <link href="static/assets/vendor/animate.css/animate.min.css" rel="stylesheet">
  <link href="static/assets/vendor/venobox/venobox.css" rel="stylesheet">
  <link href="static/assets/vendor/aos/aos.css" rel="stylesheet">

  <!-- Template Main CSS File -->
  <link href="static/assets/css/style.css" rel="stylesheet">

</head>

<body>
  <!-- ======= Header ======= -->
  <header id="header">
    <div class="container">

      <div class="logo float-left">
        <h1 class="text-light"><a href="temp.html"><span>Mamba</span></a></h1>
        <!-- Uncomment below if you prefer to use an image logo -->
        <!-- <a href="temp.html"><img src="static/assets/img/logo.png" alt="" class="img-fluid"></a>-->
      </div>

      <nav class="nav-menu float-right d-none d-lg-block">
        <ul>
          <li class="active"><a href="/index">首页 <i class="la la-angle-down"></i></a></li>
          <li><a href="/movie">电影</a></li>
          <li><a href="/score">评分</a></li>
          <li><a href="/word">词云</a></li>
          <li><a href="/team">团队</a></li>
        </ul>
      </nav><!-- .nav-menu -->

    </div>
  </header><!-- End Header -->

<!-- ======= Our Team Section ======= -->
    <section id="team" class="team">
      <div class="container">

        <div class="section-title">
          <h2>豆瓣电影Top250评分分布图</h2>
          <p>应用python实现</p>
        </div>
          <!-- ======= Counts Section ======= -->
        <section class="counts section-bg">
          <div class="container">

            <!-- 为 ECharts 准备一个定义了宽高的 DOM -->
            <div id="main" style="width: 100%; height:400px;"></div>



          </div>
        </section><!-- End Counts Section -->

        </div>
    </section><!-- End Our Team Section -->



  <script type="text/javascript">
    var dom = document.getElementById('main');
    var myChart = echarts.init(dom, null, {
      renderer: 'canvas',
      useDirtyRect: false
    });
    var app = {};

    var option;

    option = {
      color:['#4c33d8'],
      tooltip:{
        trigger:'axis',
        axisPointer:{
          type:'shadow'
        }
      },
      gird:{
        left:'3%',
        right:'4%',
        bottom:'3%',
        cantainLabel:true
      },
      xAxis: {
        type: 'category',
          <!-- ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] -->
        data: {{ score }}   <!--  补充：如果score里面的内容是含转义字符的字符串，可以score|tojson，使用tojson转换 -->
      },
      yAxis: {
        type: 'value'
      },
      series: [
        {
            <!--[120, 200, 150, 80, 70, 110, 130],-->
          data: {{ num }},
          type: 'bar'
        }
      ]
    };

    if (option && typeof option === 'object') {
      myChart.setOption(option);
    }

    window.addEventListener('resize', myChart.resize);
  </script>


  <!-- ======= Footer ======= -->
  <footer id="footer">

    <div class="container">
      <div class="copyright">Copyright &copy; 2020.Company name All rights reserved.<a target="_blank" href="http://sc.chinaz.com/moban/">&#x7F51;&#x9875;&#x6A21;&#x677F;</a></div>
      <div class="credits"></div>
    </div>
  </footer><!-- End Footer -->

  <a href="#" class="back-to-top"><i class="icofont-simple-up"></i></a>
  <script src="static/assets/js/main.js"></script>

</body>

</html>